<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.utils.ConfigManager" %>
<%@ page import="com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/rmaReceive.do?action=receiveReport"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();
String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + ""; //try { %>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<script language="javascript">

window.onload = init;
function init()
{
    if ( document.rmaReceiveForm.processStepId  != null)
    {
        qs_1 = new QuickSearch( document.rmaReceiveForm.processStepId, document.rmaReceiveForm.qs1, false);
    }
    if ( document.rmaReceiveForm.customerId  != null)
    {
        qs_2 = new QuickSearch( document.rmaReceiveForm.customerId, document.rmaReceiveForm.qs2, false);
    }
}

function reset()
{
    document.rmaReceiveForm.reset();
    qs_1.resetQuickSearchCntrl();
    qs_2.resetQuickSearchCntrl();

}
var dateElement = "";
function openCalendar(dateValue)
{
    dateElement = dateValue;
	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
	newWindow.moveTo(550,180);
	newWindow.focus();
}

function assignDate(passedValue)
{
	dateElement.value=passedValue;
	window.focus();
}

function submitReport()
{
    form = document.rmaReceiveForm;
    errMsg = '';

    var pa	= document.getElementById("message");

    if ( chkDate ( form.fromDate.value , 'From Date ' , 'Y' ) == false )
    {
          pa.innerHTML = errMsg;
          form.fromDate.focus();
          return;
    }
    if ( chkDate ( form.toDate.value , 'To Date ' , 'Y' ) == false )
    {
          pa.innerHTML = errMsg;
          form.toDate.focus();
          return;
    }
    if(form.fromDate.value!='' && form.toDate.value!='')
    {
        if (!validateDateOut(formatDateAsMMDDYYYY(form.fromDate.value),formatDateAsMMDDYYYY(form.toDate.value)))
        {
            pa.innerHTML = "To Date cannot be less than From Date";
            form.toDate.focus();
            return;
        }
    }

    form.action = "<%=chipTracContext%>/rmaReceive.do?action=receiveReportExcel";
    form.submit();

}

</script>
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
    <!-- Side Navigation start -->
    <%@ include file="/jsp/operations/reports_side_menu.jsp" %>
    <!-- end of the side navigations -->
    </TD>
    <TD bgcolor="#ffffff">
        <IMG height="9" src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="8"></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="2"></TD>
        <TD valign="top" width="100%">
        <IMG height="1" src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width="500" border="0">
        <BR>
        <html:form name="rmaReceiveForm" type="com.scalar.chiptrack.operations.dataentry.rmaReceive.forms.RMAReceiveForm" action="/rmaReceive.do?action=receiveReport">
        <TABLE border="0" width="100%" align="center">
            <TR><TD colspan="6" class="NArialW" align="center">RMA Receive Report</TD></TR>

            <TR><TD colspan="6">&nbsp;</TD></TR>
            <TR><TD width="12%" >&nbsp;</TD><TD colspan="6" class='NArialL' align="left"><strong><FONT id="message" styleClass="NArialL" color='FF0000'>&nbsp;</FONT></strong></TD></TR>
            <TR>
                <TD>&nbsp;</TD>
                <TD colspan="6" align="left">
                  <chiptrack:info styleClass="NArialL" />
                  <chiptrack:errors styleClass="NArialL" />
                  <chiptrack:messages type="info" styleClass="NArialL" />&nbsp;
                </TD>
            </TR>
            <TR>
                <TD colspan="6">
                    <TABLE align="center" border="0" width="100%" cellspacing="3" cellpadding="2">
                        <logic:present name="partNumberList" >
                        <TR>
                            <TD width="10%" class="NArialL">&nbsp;</TD>
                            <TD class="NArialL" width='15%' align='left'>Quick Search:</TD>
                            <td class="NArialL" width='20%'>
                            <input type="text" name="qs1" class="txfield" size='30' onkeyup='quickSearch(qs_1);'/>
                            </td>
                            <TD width="15%" class="NArialL" align="left">Quick Search:</TD>
                            <TD width="20%" class="NArialL"><input type="text" name="qs2" class="txfield" size='30' onkeyup='quickSearch(qs_2);'/></TD>
                            <TD width="15%" class="NArialL">&nbsp;</TD>
                        </TR>
                        </logic:present>
                            <TR>
                            <TD width="10%" >&nbsp;</TD>
                            <TD width="15%" class="NArialL" valign = 'top' align = "left">Part Number: </TD>
                            <TD width="20%" class="NArialL" valign = 'top'>
                                <html:select property="processStepId" name="rmaReceiveForm" styleClass="txfield">
                                    <html:option value="0">All Part Numbers</html:option>
                                    <html:options collection="partNumberList" property="value" labelProperty="label"/>
                                </html:select>
                            </TD>
                            <TD width="15%" nowrap align='left' class="NArialL">Customer Name:</TD>
                            <TD width="20%" class="NArialL">

                            <html:select property="customerId" name="rmaReceiveForm" styleClass="txfield">
                            <html:option value="0">--Select Customer--</html:option>
                            <html:options collection="customersList" property="value" labelProperty="label"/>
                            </html:select>
                            </TD>
                            <TD width="15%">&nbsp;</TD>
                         </TR>
                         <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                         <TR>
                            <TD width="10%" >&nbsp;</TD>
                            <TD width="15%">&nbsp; </TD>
                            <TD width="20%"> &nbsp;</TD>

                            <TD width="15%" class="NArialL" valign = 'top' align = "left" nowrap="true">&nbsp;&nbsp;To Vendor:</TD>
                            <TD width="20%" class="NArialL" valign = 'top'>
                                <html:select property="vendorName" name="rmaReceiveForm" styleClass="txfield">
                                    <html:options collection="locationList" property="label" labelProperty="label"/>
                                </html:select>
                            <TD width="15%">&nbsp;</TD>
                         </TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                        <TR>
                            <TD width="10%">&nbsp;</TD>
                            <TD width="15%" class="NArialL" valign="top" nowrap="true">From Date:<font color="red">*</font> </TD>
                            <TD width="20%" class="NArialL" valign="top"><html:text property="fromDate" name="rmaReceiveForm" styleClass="txfield" size="16" maxlength="10"/>
                                <a href="javascript:openCalendar( document.rmaReceiveForm.fromDate )">
                                <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>


                            </TD>
                            <TD width="15%" class="NArialL" valign="top" align = "left">&nbsp;&nbsp;To Date:<font color="red">*</font></TD>
                            <TD width="20%" class="NArialL" valign="top"><html:text property="toDate" name="rmaReceiveForm" styleClass="txfield" size="16" maxlength="10"/>
                                <a href="javascript:openCalendar( document.rmaReceiveForm.toDate )">
                                <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>

                            </TD>
                            <TD width="15%">&nbsp;</TD>
                        </TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                       <TR>
                           <%-- <td colspan=2 valign="top">&nbsp;</td>--%>
                            <TD colspan="6" align=center valign="top">
                                <a href="javascript:submitReport();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to Generate RMA Receive Report';return true" onmouseout="window.status='';return true" title='Click to Generate RMA Receive Report'></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="javascript:document.rmaReceiveForm.reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to reset search';return true" onmouseout="window.status='';return true" title="Click here to reset search"></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </TD>
                            <%--<td colspan=2 valign="top">&nbsp;</td>--%>
                       </TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        </html:form>
    </TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
<%-- } catch(Exception e){e.printStackTrace();} --%>
